
 <script type="text/javascript"> 
function timeoutMsg() //TimeOut Function
 {
    setTimeout("alertMsg()",19800000); //Set an alret message that will appear to the user after 5hrs and half
 }
function alertMsg() //alret message function that will appear
 {
     alert('Warning: You will be Logged out after 30 mins'); //an alret message that the system will logged out after 30 mins
     setTimeout("disableMsg()",1800000);  // Set timeout message after 30 mins to display the use of the page
 }
 function disableMsg() //function that will disable the use of system
 {   
     alert('Please SignIn again'); // message appear to the user asks him to SignIn again
<?php

session_start();
// used to start inialize the session

 $_SESSION = array();
 // this will delete the variable of the session which is the user name


  session_destroy();
 // delete session
 
 header("Location: index.php" );
 // return to the login page again
 ?>
 }
 
</script>


